import promotionApi from "@/api/declaration/mall/promotionApi"
import httpRequest from "@/config/axios/httpRequest"
import { ArticleModel } from "@/models/mall/ArticleModel"


// 查询文章管理列表
export const getArticlePage = async (params: any) => {
  return await httpRequest.get(promotionApi.GetArticlePage, { params })
}

// 查询文章管理详情
export const getArticle = async (id: number) => {
  return await httpRequest.get(promotionApi.GetArticle, { params: { id } })
}

// 新增文章管理
export const createArticle = async (data: ArticleModel) => {
  return await httpRequest.post(promotionApi.CreateArticle, data)
}

// 修改文章管理
export const updateArticle = async (data: ArticleModel) => {
  return await httpRequest.put(promotionApi.UpdateArticle, data)
}

// 删除文章管理
export const deleteArticle = async (id: number) => {
  return await httpRequest.delete(promotionApi.DeleteArticle, { params: { id } })
}
